<%--
  Created by IntelliJ IDEA.
  User: semmer-gs
  Date: 2021/12/7
  Time: 10:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>测试</title>
    <script type="text/javascript" src="script/jquery.min.js"></script>
  </head>
  <body>
    <a href="hello">hello</a><br/>
    <a href="testSpringMvc/testRequestMapping">testRequestMapping</a><br/>
    <a href="testSpringMvc/testMethod">testMethod</a><br/>
    <form action="testSpringMvc/testMethod" method="post">
      <input type="submit" value="testMethod">
    </form><br/>
    <a href="testSpringMvc/testParamsAndHeaders?userName=summer&age=11">testParamsAndHeaders</a><br/>
    <a href="testSpringMvc/testAntPath/test/abc">testAntPath</a><br/>
    <a href="testSpringMvc/testPathVariable/20">testPathVariable</a><br/>
    <p>REST 风格请求测试</p>
    <a href="testSpringMvc/testRest/1">testRest GET</a><br/>
    <form action="testSpringMvc/testRest" method="post">
      <input type="submit" value="testRest POST">
    </form><br/>
    <form action="testSpringMvc/testRest/1" method="post">
      <input type="hidden" name="_method" value="DELETE">
      <input type="submit" value="testRest DELETE">
    </form><br/>
    <form action="testSpringMvc/testRest/1" method="post">
      <input type="hidden" name="_method" value="PUT">
      <input type="submit" value="testRest PUT">
    </form><br/><br/><br/>

    <a href="testSpringMvc/testRequestParam?userName=summer&age=11&sex=man">testRequestParam</a><br/>

    <a href="testSpringMvc/testRequestHeader">testRequestHeader</a><br/>

    <a href="testSpringMvc/testCookieValue">testCookieValue</a><br/>


    <form action="testSpringMvc/testPOJO" method="post">
      <input type="text" name="name" value="summer" />
      <input type="text" name="sex" value="man" />
      <input type="number" name="age" value="10" />
      <input type="text" name="address.province" value="hunan" />
      <input type="text" name="address.city" value="cz" />
      <input type="submit" value="testPOJO" />
    </form><br/>


    <a href="testSpringMvc/testServletAPI">testServletAPI</a><br/>

    <a href="testSpringMvc/testModelAndView">testModelAndView</a><br/>

    <a href="testSpringMvc/testMap">testMap</a><br/>

    <a href="testSpringMvc/testSessionAttributes">testSessionAttributes</a><br/>

    <!--
      模拟修改操作
      1. 原始数据为: {id: 1, name: summer, sex: man, age: 10}
      2. 期望 token 不能被修改.
      3. 表单回显,模拟操作直接在表单填写对应的属性值
      可以通过 @ModelAttribute 实现
    -->
    <form action="testSpringMvc/testModelAttribute" method="post">
      <input type="hidden" name="id" value="1" />
      <input type="text" name="name" value="summer" />
      <input type="text" name="sex" value="man" />
      <input type="number" name="age" value="10" />
      <input type="text" name="address.province" value="hunan" />
      <input type="text" name="address.city" value="cz" />
      <input type="submit" value="testModelAttribute" />
    </form><br/><br/>

    <a href="testSpringMvc/testViewAndViewResolver">testViewAndViewResolver</a><br/>
    <a href="testSpringMvc/testSummerView">testSummerView</a><br/>
    <a href="testSpringMvc/testRedirect">testRedirect</a><br/>

    <!--  mvc -->
    <a href="employees">employees</a><br/>

    <a href="testJson" id="testJson">testJson</a><br/>
    <script type="text/javascript">
      $(function() {
        $("testJson").click(function () {
          $.post($("testJson".href), {}, function (data) {
            for(var index in data) {
              alert(data[index].id + ":" + data[index].lastName);
            }
          })
          return false;
        });
      })
    </script>

    <form action="testHttpMessageConverter" method="post" enctype="multipart/form-data" >
      File:<input type="file" name="file" />
      Desc:<input type="text" name="desc" />
      <input type="submit" name="submit">
    </form><br/>

    <a href="testResponseEntity">testResponseEntity</a><br/>

  <!--
   关于国际化;
    1。在页面上能够根据浏览器语言设置的情况对文本(不是内容)，时间，数值进行本地化处理
    2。可以在bean中获取国际化资源文件Locale对应的消息
    3。可以通过超链接切换Locale，而不再依赖于浏览器的语言设置情况
    解决:
    1。使用 JSTL 的fmt标签
    2．在 bean 中注入 ResourceBundleMessageSource 的示例，使用其对应的 getMessage
    3。配置 LocalResolver 和 LocaleChangeInterceptor
   -->
  <a href="i18n1">i18n1</a><br/>

    <form action="testFileUpload" method="post" enctype="multipart/form-data" >
      File:<input type="file" name="file" />
      Desc:<input type="text" name="desc" />
      <input type="submit" name="submit">
    </form><br/>

    <a href="testExceptionHandlerExceptionResolver?i=10">testExceptionHandlerExceptionResolver</a><br/>
    <a href="testResponseStatusExceptionResolver?i=10">testResponseStatusExceptionResolver</a><br/>
    <a href="testHandlerExceptionResolver">testHandlerExceptionResolver</a><br/>
    <a href="testSimpleMappingExceptionResolver?i=2">testSimpleMappingExceptionResolver</a><br/>
  </body>
</html>
